import Vue from 'vue'
import App from './App.vue'

// import '@/css/common.css'

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)

import router from './router'
import store from './store'
import * as echarts from 'echarts'

Vue.config.productionTip = false
Vue.prototype.$echarts = echarts
// 第一步: 引入router 插件
import VueRouter from 'vue-router'
Vue.use(VueRouter)

import VScaleScreen from 'v-scale-screen'
Vue.use(VScaleScreen)

import scroll from 'vue-seamless-scroll'
Vue.use(scroll)
//使用echarts
// import { removeToken } from '@/utils/auth'

import lottie from 'vue-lottie'
// eslint-disable-next-line vue/multi-word-component-names
Vue.component('lottie', lottie)
// 引入lottie

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

window.addEventListener('unload', function () {
  localStorage.clear()
  sessionStorage.clear()
  // removeToken()
})

Vue.prototype.openLoading = function () {
  const loading = this.$loading({
    lock: true,
    text: '加载中',
    spinner: 'el-icon-loading',
    background: 'rgba(255,255, 255, 0.6)',
    fullscreen: true
  })
  setTimeout(function () {
    loading.close()
  }, 3000)
  return loading
}
